home *** CD-ROM | disk | FTP | other *** search
-
- /* constant black pallet-date program accessory ; prepared 20Jan'87 CJPurcell*/
- /* reference "Ein Wecker im ST" - "An ST_Alarm"
- extracted from ST Computer,Nr 10 ,pp. 36-38 ,1986;
- pub. in Germany in German. Works with MWC 12 Oct86-CJP with corrections! */
-
- /* The accessory build is found in the new version of MWC using -VGEMACC opt */
-
- #include <osbind.h> /* system constants */
- #include <gemdefs.h> /* GEM-definition */
- #include <obdefs.h> /* object definition */
-
- int contrl[12],intin[128],intout[128],ptsin[128],ptsout[128];
- extern int gl_apid; /* AES processor call */
- /* bei,i.e.for, GST: extern short gl_apid; */
- #define RC_COORDS 2
- /*
- short green[] = { 0x676,0x601,0x051,0x001,0x777,0x700,0x070,0x770,
- 0x007,0x707,0x077,0x555,0x333,0x733,0x373,0x773 }; */
- main()
- {
- register unsigned long zeit; /* for MWC: time variable */
- static char tag[] = "20/01/87" ; /* static day */
- /* needs date in centered "dd/mm/yy" for lowres static day display */
- /* needs adjustment for lowres colors as well as white background on mono */
- register char zr;
- short zh,vn,h,ii,in[11],aus_0,aus_1,aus[57];
-
- appl_init();
-
- vn = graf_handle(&h,&zh,&h,&h) ; zh -= 2 ;
- for( ii = 0 ; ii < 10 ; ++ ii ) in [ii] = 1 ; /* init in array */
- in[10] = RC_COORDS ;
- v_opnvwk(in,&vn,aus);
- aus_0 = aus [0] ;
- aus_0 = aus_0 >> 1 ;
- /* aus_0 = aus_0 + ( aus [0] >> 3 ) ; */
- aus_1 = aus [1] ;
- aus_1 = aus_1 >> 5 ;
- vst_color(vn,1);
- menu_register(gl_apid," ST GEM-DATE " ) ;
-
- /* consider initializing the printer here, ala epset or setprt from MWC */
-
- zeit = Gettime()>>5;
- zeit >>= 6 ;
- zeit >>= 5 ; /* day count */
- zr = ((char)zeit) & 0x1f;
- tag[ 3] = zr / 10 + '0';
- tag[ 4] = zr % 10 + '0'; /* American day */
- zeit >>= 5; /* month count */
- zr = ((char)zeit) & 0xf;
- tag[ 0] = zr / 10 + '0';
- tag[ 1] = zr % 10 + '0'; /* American month */
- zr = ((char)((zeit >> 4) + 80L) % 100) & 0x7f;
- tag[ 6] = zr / 10 + '0'; /* year count */
- tag[ 7] = zr % 10 + '0';
-
- while(1) /* DO FOREVER 'til the next autoboot............*/
- {
- /* Setpallete(green); / *...set,reset...*/
-
- v_gtext( vn , aus_0 , aus_1 , tag ) ; /* today, forever.*/
- /* tick = 10000ms.*/
- evnt_multi(MU_TIMER ,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,aus,10000,0,&h,&h,&h,&h,&h,&h);
- }
- } /* hide, but stay resident..........forever....*/
-
-